<?php defined('IN_LK') or die('Access Denied');?>
<?php include self::admin_t('header', 'admin');?>

<form action="?m=member&c=member&a=<?php if(isset($ac)){?>edit<?php }else{?>add<?php }?>" method="post" id="myform">
<?php if(isset($ac)){?><input type="hidden" name="info[userid]" id="userid" value="<?php echo $info['userid'];?>" /><?php }?>
  <dl class="form_list">
    <fieldset>
      <legend>基本信息</legend>
      <dd><span class="left w15">用户名</span>
        <input type="text" class="input" name="info[username]" id="username" size="25" value="<?php echo isset($info['username']) ? $info['username'] : '';?>" />
      </dd>
      <dd><span class="left w15">密码</span>
        <input type="password" class="input" name="info[password]" id="password" size="25" value="" />
      </dd>
      <dd><span class="left w15">确认密码</span>
        <input type="password" class="input" name="info[password2]" id="password2" size="25" value="" />
      </dd>
      <dd><span class="left w15">昵称</span>
        <input type="text" class="input" name="info[nickname]" id="nickname" size="25" value="" />
      </dd>
      <dd><span class="left w15">E-mail</span>
        <input type="text" class="input" name="info[email]" id="email" size="40" value="" />
      </dd>
      <dd><span class="left w15">会员组</span>
      	<?php echo $select;?>
      </dd>
      <dd><span class="left w15">积分点数</span>
        <input type="text" class="input" name="info[point]" id="point" size="10" value="0" />
      </dd>
    </fieldset>
    <input class="none" type="submit" id="dosubmit" name="dosubmit" value="提交" />
  </dl>
</form>
</body></html><script type="text/javascript">
<!--
$(function()
{
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$('#username').formValidator({onshow:"请输入用户名。", onfocus:"用户名应该为3-20位之间，数字字母下划线组成。"}).inputValidator({min:3,max:20,onerror:"用户名应该为3-20位之间，数字字母下划线组成。"}).regexValidator({regexp:"username",datatype:"enum",onerror:"用户名格式错误"}).ajaxValidator({
		type : "get",
		url : "",
		data :"m=member&c=member&a=check_username_ajax",
		datatype : "html",
		async:'false',
		success : function(data){return data == "1" ?  true : false;},
		buttons: $("#dosubmit"),
		onerror : "用户名已存在",
		onwait : "请稍候..."
	});
	$("#password").formValidator({onshow:"密码应该为3-20位之间。",onfocus:"密码应该为3-20位之间。"}).inputValidator({min:3,max:20,onerror:"密码应该为3-20位之间"});
	$("#password2").formValidator({onshow:"请输入两次密码相同。",onfocus:"请输入两次密码相同。",oncorrect:"密码输入一致"}).compareValidator({desid:"password",operateor:"=",onerror:"请输入两次密码相同。"});
	$('#nickname').formValidator({empty:true, onshow:'请输入昵称', onfocus:"昵称应该为3-20位之间，汉字数字字母下划线组成", onempty:'输入昵称为空'}).inputValidator({min:3, max:20, onerror:'昵称应该为3-20位之间，汉字数字字母下划线组成'}).regexValidator({regexp:"ps_username",datatype:"enum",onerror:"昵称格式错误"}).ajaxValidator({
		type : "get",
		url : "",
		data :"m=member&c=member&a=check_nickname_ajax",
		datatype : "html",
		async:'false',
		success : function(data){return data == "1" ?  true : false;},
		buttons: $("#dosubmit"),
		onerror : "昵称已存在",
		onwait : "请稍候..."
	}).defaultPassed();
	$("#email").formValidator({onshow:"请输入E-mail",onfocus:"请输入E-mail",oncorrect:"E-mail输入正确"}).regexValidator({regexp:"email",datatype:"enum",onerror:"E-mail格式错误"}).ajaxValidator({
		type : "get",
		url : "",
		data :"m=member&c=member&a=check_email_ajax",
		datatype : "html",
		async:'false',
		success : function(data){return data == "1" ?  true : false;},
		buttons: $("#dosubmit"),
		onerror : "邮箱已经被注册了哦",
		onwait : "请稍候..."
	});
	$('#point').formValidator({onshow:'请输入积分', onfocus:'积分可能改变该用户会员组'}).regexValidator({regexp:"^\\d{1,8}$",onerror:"积分为1-8位数字"});;
});
// -->
</script>